package com.online.service_edu.controller;

import ch.qos.logback.core.net.SyslogOutputStream;
import com.alibaba.fastjson.JSONObject;
import com.online.common_utils.ResultJson;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/service_edu/user")
public class EduController {

//    @PostMapping("login")
//    public ResultJson userLogin(@RequestParam("username") String username, @RequestParam("password") String password){
//        System.out.println("username===>"+username);
//        System.out.println("password===>"+password);
//       return ResultJson.ok().data("token","123400d0ddoodod");
//    }
    @PostMapping("login")
    public ResultJson userLogin(@RequestBody JSONObject jsonParam){
        System.out.println("username===>"+jsonParam.get("username"));
        System.out.println("password===>"+jsonParam.get("password"));
        return ResultJson.ok().data("token","123400d0ddoodod");
    }

    @PostMapping("info")
    public ResultJson getuserInfo(String token){
        System.out.println("token===>"+token);
        return ResultJson.ok().data("roles","admin123").data("name","zhangsan").data("avatar","https://pics1.baidu.com/feed/7dd98d1001e93901602e206ae45150ef37d196ff.jpeg?token=a289491d5272aa0d4efe846f96f5571e&s=88431F7245737388D4C805C50300A0B1");
    }


}
